package com.ruoqing.core.dto.admin;

import com.ruoqing.core.dto.user.UserResponse;
import com.ruoqing.core.enums.AdminMessageEnum;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
	* @author YaoXian
	* @title: AdminMessageDto
	* @projectName ruoxi-blog
	* @description: 若兮微服务 - 核心模块 - 后台管理中心 -
*                消息队列发送异步可靠消息数据传输对象
	* @date 2020-11-29 18:01
	*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class AdminMessageDto {
		
		@XmlElement
		private UserResponse userResponse;
		
		@XmlElement
		private AdminMessageEnum module;
		
		@XmlElement
		private Object param;
		
		public Object getParam() {
				return param;
		}
		
		public void setParam(Object param) {
				this.param = param;
		}
		
		public UserResponse getUserResponse() {
				return userResponse;
		}
		
		public void setUserResponse(UserResponse userResponse) {
				this.userResponse = userResponse;
		}
		
		public AdminMessageEnum getModule() {
				return module;
		}
		
		public void setModule(AdminMessageEnum module) {
				this.module = module;
		}
		
		public static AdminMessageDto buildAdminMessageDto(AdminMessageEnum module, UserResponse userResponse){
				AdminMessageDto adminMessageDto = new AdminMessageDto();
				adminMessageDto.setModule(module);
				adminMessageDto.setUserResponse(userResponse);
				return adminMessageDto;
		}
		
		public static AdminMessageDto buildAdminMessageDto(AdminMessageEnum module, UserResponse userResponse,Object param){
				AdminMessageDto adminMessageDto = new AdminMessageDto();
				adminMessageDto.setModule(module);
				adminMessageDto.setUserResponse(userResponse);
				adminMessageDto.setParam(param);
				return adminMessageDto;
		}
}
